<template>
  <el-date-picker
    v-model="value"
    type="datetimerange"
    start-placeholder="开始时间"
    end-placeholder="结束时间"
    format="YYYY-MM-DD HH:mm:ss"
    value-format="YYYY-MM-DD HH:mm:ss"
    :default-time="defaultTime"
    v-bind="$attrs"
  />
</template>
<script setup>
const modelValue = ref([]);
const props = defineProps({
  modelValue: { type: Array, default: () => [] },
  defaultTime: {
    type: Array,
    default: () => [
      new Date(2000, 1, 1, 0, 0, 0),
      new Date(2000, 2, 1, 23, 59, 59),
    ],
  },
});
const emit = defineEmits(["update:modelValue"]);
const value = computed({
  get: () => props?.modelValue||[],
  set: (val) => emit("update:modelValue", val?val:[]),
});
</script>
